<?php $this->pageTitle = '浏览组'; ?>
<!-- h2 stays for breadcrumbs -->
<h2><a href="#">后台管理</a> &raquo; <a href="#" class="active"><?php __('浏览组');?></a></h2>
<div id="main">
<div class="groups view">
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('ID'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $group['Group']['id']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('组名'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $group['Group']['name']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('创建时间'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $group['Group']['created']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('修改时间'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $group['Group']['modified']; ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('修改组', true), array('action' => 'edit', $group['Group']['id'])); ?> 
		<?php echo $html->link(__('删除组', true), array('action' => 'delete', $group['Group']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $group['Group']['id'])); ?> 
		<?php echo $html->link(__('管理组', true), array('action' => 'index')); ?> 
		<?php echo $html->link(__('新建组', true), array('action' => 'add')); ?> 
		<?php echo $html->link(__('用户管理', true), array('controller' => 'users', 'action' => 'index')); ?> 
		<?php echo $html->link(__('新建用户', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php __('相关的用户');?></h3>
	<?php if (!empty($group['User'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('ID'); ?></th>
		<th><?php __('用户名'); ?></th>
		<!--<th><?php __('Password'); ?></th>-->
		<th><?php __('组ID'); ?></th>
		<th><?php __('创建时间'); ?></th>
		<th><?php __('修改时间'); ?></th>
		<th class="actions"><?php __('操作');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($group['User'] as $user):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="odd"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $user['id'];?></td>
			<td><?php echo $user['username'];?></td>
			<!--<td><?php echo $user['password'];?></td>-->
			<td><?php echo $user['group_id'];?></td>
			<td><?php echo $user['created'];?></td>
			<td><?php echo $user['modified'];?></td>
			<td class="action">
				<?php echo $html->link(__('浏览', true), array('controller' => 'users', 'action' => 'view', $user['id']), array('class' => 'view')); ?>
				<?php echo $html->link(__('编辑', true), array('controller' => 'users', 'action' => 'edit', $user['id']), array('class' => 'edit')); ?>
				<?php echo $html->link(__('删除', true), array('controller' => 'users', 'action' => 'delete', $user['id']), array('class' => 'delete'), sprintf(__('Are you sure you want to delete # %s?', true), $user['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>
	<div class="actions">
		<ul>
			<li><?php echo $html->link(__('新建用户', true), array('controller' => 'users', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
</div>
